﻿namespace Common.Utils
{
    /// <summary>
    /// 配置辅助类
    /// </summary>
    /// <remarks>
    /// 提供应用程序的配置常量和辅助方法
    /// </remarks>
    public static class ConfigHelper
    {
        /// <summary>
        /// 文件最大大小
        /// </summary>
        public const long MaxFileSize = 10_737_418_240; // 10GB  

        /// <summary>
        /// 文件下载超时时间
        /// </summary>
        public static TimeSpan MaxTimeout = TimeSpan.FromHours(2);

        /// <summary>
        /// 缓冲区大小
        /// </summary>
        public static int BufferSize = 512 * 1024;

        /// <summary>
        /// 请求缓冲区大小
        /// </summary>
        public static long MaxRequestBufferSize = 8 * 1024 * 1024;

        /// <summary>
        /// 响应缓冲区大小
        /// </summary>
        public static long MaxResponseBufferSize = 8 * 1024 * 1024;

        /// <summary>
        /// 最大重试次数
        /// </summary>
        public static int MaxRetries = 3;

        /// <summary>
        /// 重试延迟时间
        /// </summary>
        public static TimeSpan RetryDelay = TimeSpan.FromSeconds(5);

        /// <summary>
        /// 连接保持活动时间
        /// </summary>
        public static TimeSpan KeepAliveTimeout = TimeSpan.FromMinutes(5);

        /// <summary>
        /// 最大连接数
        /// </summary>
        public static int MaxConnections = 100;
    }
}
